package entity

import (
	"shqsoft.cn/pasnj/base"
)

//TIndiClie 用户
type TCompDiviWorkflowStep struct {
	ID           int    `gorm:"AUTO_INCREMENT;primary_key;column:ID"`
	WFID         int    `gorm:"column:WFID"`
	EMID         int    `gorm:"column:EMID"`
	STATE        int    `gorm:"column:STATE"`
	STATECaption string `gorm:"-"`
	DESC         string `gorm:"DESC"`
	STEP         int    `gorm:"STEP"`
}

//TableName User用户表名
func (TCompDiviWorkflowStep) TableName() string {
	return "T_COMP_DIVI_WORKFLOW_STEP"
}
func (u *TCompDiviWorkflowStep) AfterFind() (err error) {
	if u.STATE == -1 {
		u.STATECaption = "退回"
	} else if u.STATE == 1 {
		u.STATECaption = "未处理"
	} else if u.STATE == 2 {
		u.STATECaption = "已提交"
	}
	return
}

func TCompDiviWorkflowStepEF() base.EntityFunc {
	return func() interface{} {
		entity := TCompDiviWorkflowStep{}
		return &entity
	}
}
func TCompDiviWorkflowStepESF() base.EntitiesFunc {
	return func() interface{} {
		var entities []TCompDiviWorkflowStep
		return &entities
	}
}

func init() {
	base.DaoPoolObj.Put("TCompDiviWorkflowStep", base.NewDefaultDao(TCompDiviWorkflowStepEF(), TCompDiviWorkflowStepESF(), nil))
}
